/**
 * Created by dqw on 2015/12/30.
 */

//列表开始
var dtGridColumns = [
    {
        id: 'id',
        title: 'ID',
        type: 'number',
        columnClass: 'text-center width-100',
        fastSort: false,
        fastQuery: true,
        fastQueryType: 'eq'

    },
    {
        id: 'inviteId',
        type: 'int',
        hideQuery:true,
        'export':false,
        hideQueryType:'eq',
        hideQueryValue:$('#uId').val(),
        hide:true
    },
    {
        id: 'userName',
        title: '用户名',
        type: 'string',
        headerClass: 'text-left',
        columnClass: 'text-left',
        fastSort: false,
        fastQuery: true,
        fastQueryType: 'lk'
    },
    {
        id: 'registerTime',
        title: '注册时间',
        type: 'date',
        format:'yyyy-MM-dd',
        headerClass: 'text-left',
        columnClass: 'text-left',
        fastSort: false,
        fastQuery: true,
        fastQueryType: 'range'
    },
    {
        id: 'mobilePhone',
        title: '电话',
        type: 'string',
        headerClass: 'text-left',
        columnClass: 'text-left width-200',
        fastSort: false,
        fastQuery: true,
        fastQueryType: 'lk'
    },
];

var dtGridOption = {
    lang: 'zh-cn',
    ajaxLoad: true,
    loadURL: ncGlobal.adminRoot + '/user/userInvestor.json',
    exportFileName: '我的下线列表',
    columns: dtGridColumns,
    gridContainer: 'dtGridContainer',
    toolbarContainer: 'dtGridToolBarContainer',
    pageSize: 10,
    pageSizeLimit: [10, 20, 50],
    ncColumnsType: {int:["id"],Timestamp:["registerTime"]}
};

var grid = $.fn.DtGrid.init(dtGridOption);
//默认查询条件
grid.fastQueryParameters = new Object();
grid.fastQueryParameters['eq_inviteId'] = $('#uId').val();
//排序
grid.sortParameter.columnId = ['asc_id'];
// grid.sortParameter.sortType = 0;
//列表结束

//操作处理开始
var OperateHandle = function () {

    function _bindEvent() {

        //模糊搜索
        $('#customSearch').click(function () {

        });
    }

    //外部可调用
    return {
        bindEvent: _bindEvent
    }
}();
//操作处理结束

$(function () {
    //加载列表
    grid.load();
    //页面绑定事件
    OperateHandle.bindEvent();
});